package com.selvn.encryptnote;

import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.Context;
import android.widget.RemoteViews;

public class MyAppWidgetProvider extends AppWidgetProvider
{
	public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds)
	{
		// Func.Toast(context, "test");
		final int N = appWidgetIds.length;
		for (int i = 0; i < N; i++)
		{
			int appWidgetId = appWidgetIds[i];
			RemoteViews views = new RemoteViews(context.getPackageName(),
					R.layout.notewidget);
			String tipText = Func.ReadFileFromInternal(context, Config.TIPPATH);

			views.setTextViewText(R.id.tip, tipText);

			appWidgetManager.updateAppWidget(appWidgetId, views);
		}
	}
}
